package com.ktjy.timing;

import com.ktjy.service.impl.MailService;
import jakarta.mail.MessagingException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
public class MyTask {
//    @Autowired
//    private MailService mailService;
//
//    @Scheduled(cron = "0/10 * * * * ?")
//    public void task(){
//        System.out.println("定时任务执行了");
//        for (int i = 0; i < 10; i++){
//            try {
//                mailService.send("3309414600@qq.com","2164681179@qq.com","测试邮件","像一个下笔",null,null);
//            } catch (MessagingException e) {
//                throw new RuntimeException(e);
//            }
//        }
//    }
}
